package test;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import test.model.Users;
import java.sql.Timestamp;

public class InsertUsers {

	public static void main(String[] args) {
		try {
			SessionFactory sf = new Configuration().configure().buildSessionFactory();
			Session session = sf.openSession();
			Transaction tx = session.beginTransaction();
			Users users= new Users();
			users.setUsername("007");
			users.setPassword("1234567");
			users.setUsertag("1");
			Timestamp time = new Timestamp(System.currentTimeMillis());
			users.setLatestlogtime(time);
			session.save(users);
			tx.commit(); 
			session.close(); 
			}catch (HibernateException e) { e.printStackTrace(); } 	
	}
}
